package com.maccman.aireo.vo
{
	import com.adobe.cairngorm.vo.IValueObject;
	import com.maccman.aireo.model.AireoModelLocator;
	
	[Bindable]
	[RemoteClass(alias="com.maccman.aireo.vo.AssetVO")]
	public class AssetVO implements IValueObject
	{

		public var id : Number;
		public var name : String;
		private static var model:AireoModelLocator = AireoModelLocator.getInstance();
		
		public function update(data:Object):void {
		 this.id = data.id
		 this.name = data.name
		}
		
		public function destroy():void {
			var i:Number = model.assets.getItemIndex(this);
			model.assets.removeItemAt(i)
		}
		
		public static function find(id:Number):AssetVO {
			return model.assets.find(id) as AssetVO;
		}
	}
}